import os os.path.dirname(os.path.abspath(__file__))
import os os.path.basename(__file__)
import os.path extension = os.path.splitext(filename)[1]
import pathlib pathlib.Path(__file__).parent.absolute()